﻿using System.Web;

namespace CRMWeb.Utilities.Context
{
    public static class HTTPHelper
    {
        public static bool IsUserAuthenticated()
        {
            if (HttpContext.Current == null || HttpContext.Current.User == null)
            {
                return ValidationHelper.GetBoolean(AbstractStockHelper<RequestStockHelper>.GetItem("IsUserAuthenticated", true), false);
            }
            return HttpContext.Current.User.Identity.IsAuthenticated;
        }

        public static string GetUserName()
        {
            if (HttpContext.Current == null || HttpContext.Current.User == null)
            {
                return string.Empty;
            }
            return HttpContext.Current.User.Identity.Name;
        }
    }
}